
#ifndef _TSLINKDRV_H_
#define _TSLINKDRV_H_

#include <defts101.h>
#include <sysreg.h>
#include <signal.h>

#ifndef TS_EXTERN
#define TS_EXTERN  extern
#endif


#define LINK_SPEED_0	LCTL_DIV2
#define LINK_SPEED_1	LCTL_DIV3
#define LINK_SPEED_2	LCTL_DIV4
#define LINK_SPEED_3	LCTL_DIV8



TS_EXTERN	void 	LinkInit(int linkno, int speed);

TS_EXTERN	int 	IsLinkDMADone(int linkno);


TS_EXTERN   void 	LinkRecvDMAW (int linkno, void* DestAddr, unsigned int nWords);
TS_EXTERN	void 	LinkSendDMAW (int linkno, void* SrcAddr,  unsigned int nWords);
TS_EXTERN   void 	LinkRecvDMA  (int linkno, void* DestAddr, unsigned int nWords);
TS_EXTERN	void 	LinkSendDMA  (int linkno, void* SrcAddr,  unsigned int nWords);
TS_EXTERN   void 	LinkRecvCore (int linkno, void* DestAddr, unsigned int nWords);
TS_EXTERN	void 	LinkSendCore (int linkno, void* SrcAddr,  unsigned int nWords);
TS_EXTERN   void 	LinkRecv2DDMAW(int linkno, void* DestAddr, unsigned int nCol, unsigned int nRow);
TS_EXTERN	void 	LinkSend2DDMAW(int linkno, void* SrcAddr, unsigned int nCol, unsigned int nRow);
TS_EXTERN   void 	LinkRecv2DDMA(int linkno, void* DestAddr, unsigned int nCol, unsigned int nRow);
TS_EXTERN	void 	LinkSend2DDMA(int linkno, void* SrcAddr, unsigned int nCol, unsigned int nRow);
#endif
